require(["config"],function(){
	require(["jquery","carousel"],function($){
		function Index(){
			this.loadCarousel();
			this.addListener();
		};
		Index.prototype={
			constructor:Index,
			loadCarousel: function() {
				$(".slider-wrapper").carousel({
					imgs : [
						{href:"#", src:"/images/pc2018070516360633316.jpg"},
						{href:"#", src:"/images/pc2018071018212613783.jpg"},
					],
					width:1200,
					height: 425,
					duration: 3000
				});
			},
			renderList:function(){
				$.ajax("http://rap2api.taobao.org/app/mock/87266/api/list")
				.done((data)=>{
					//待渲染数据
					var data = {list:data.res_body.list};
					//渲染
					var html = template("list_template",data);
					$("#cakeList").html(html);
					
				})
			},
			
			addListener:function(){
				console.log("111")
				$("#qrcode-close").click(this.closeCart);
			},
			closeCart:function(){
				$(".qrcode-sw").attr("style","display:none;")
			}
		
		}
		new Index();
	});
});